#include <stdio.h>
#include <fcntl.h>
static unsigned char send_buf[10]="1234567";
static unsigned char recv_buf[10];
static void pabort(const char *s)
{
  perror(s);
  abort();
}
int main(){
  int fd;
  int num = 5;
  int i=0;
  printf("1^1=%d,1^0=%d,0^0=%d\n",1^1,1^0,0^0);
  /* open the pneumatic DSP bin code file. */
  fd = open("/dev/spi_ww", O_RDWR);
  if (fd < 0)
    pabort("can't open SPI device");
  ioctl(fd,0,200);
  write(fd,send_buf,num);
  read(fd,recv_buf,num);
  for(i=0;i<num;i++)
    printf("recv_buf[%d]:%d\n",i,recv_buf[i]);
  close(fd);
 return 0;
}

